/*
Same Tree

Given two binary trees, write a function to check if they are equal or not.

Two binary trees are considered equal if they are structurally identical and the nodes have the same value.
*/

#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
#include <string>
#include <stack>
#include <fstream>
#include <sstream>
#include "print.h"
using namespace std;

/**
* Definition for binary tree*/
 struct TreeNode {
     int val;
     TreeNode *left;
     TreeNode *right;
     TreeNode(int x) : val(x), left(NULL), right(NULL) {}
};



void testForStack()
{
	stack<int> mystack;
	mystack.push(10);
	mystack.push(20);
	mystack.top() -= 5;
	cout << "mystack.top() is now " << mystack.top() << endl;
}

void testForIntToString()
{
	int a = 10;
	stringstream ss;
	ss << a;
	string str = ss.str();
	cout << str << endl;

	string str1 = to_string(a);

}





class Solution {
public:
	bool isSameTree(TreeNode *p, TreeNode *q) {

		if (p == NULL && q ==NULL)
		{
			return true;
		}
		else if (p== NULL && q != NULL)
		{
			return false;
		}
		else if (p != NULL && q == NULL)
		{
			return false;
		}
	

		if (p->val == q->val)
		{
			return (isSameTree(p->left, q->left)) && (isSameTree(p->right, q->right));
		}
		else
		{
			return false;
		}
		
		

		
	}
};




int main(int argc, char* argv[])
{

	Solution s;


	for (int i = 1; i < argc; i++){

		
		cout << argv[i] << endl;

	}

	int A[] = { 1, 2, 3, 0, 0 };
	int B[] = { 2, 4 };
	//cout << << endl;
	


	system("pause");
	return 0;
}